package com.example.boot.config;

import com.example.boot.service.OptLogSaveService;
import com.lemon.core.log.annotation.EnableOperateLog;
import com.lemon.core.log.events.OperateLogListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 操作日志记录配置
 *
 * @author pan
 * @since 2019-11-06
 */
// 开启日志
@EnableOperateLog
@Configuration
public class LogConfiguration {

    @Bean
    public OperateLogListener operateLogListener(OptLogSaveService optLogService) {
        return new OperateLogListener(optLogService::createLog);
    }

}
